﻿<UserControl x:Class="StockholmsStad.Windows.UI.Infrastructure.Controls.CustomDatePicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dateControls="clr-namespace:Microsoft.Samples.KMoore.WPFSamples.DateControls;assembly=J832.Wpf.BagOTricksLib"
    Height="20" MinWidth="120">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <TextBox x:Name="tbText" LostFocus="tbText_LostFocus" MaxLength="10" />

        <Grid Grid.Column="1" Margin="3,0,0,0">
            <Image Source="calendar2.png" Cursor="Hand"  MouseLeftButtonDown="openPopup_Click" />

            <Popup x:Name="popupControl" PlacementRectangle="0, 0, 0 ,0" StaysOpen="False" Grid.Column="1">
                <Grid>
                    <dateControls:MonthCalendar x:Name="dateControl" DateSelectionChanged="MonthCalendar_DateSelectionChanged" />
                </Grid>
            </Popup>
        </Grid>
    </Grid>
</UserControl>
